package org.csmz.class2333;

public class Example07 {
    public static void main(String[] args){
        String id="user";
        String time="2023-1112-13336";
        String orderID = id.concat(time);
        System.out.println("将字符串"+time+"拼接到字符串"+id+"的末尾"+"生产的订单号为"+orderID);
        System.out.println("截取字符串"+orderID+"的第5个字符到第14个字符，"+"结果为"+orderID.substring(4,13));
        System.out.println("将字符串"+time+"用符号-分割为若干个子字符串，结果为");
        String [] times = time.split("-");
        for (int i=0;i<times.length;i ++){
            if (i != times.length - 1) {
                System.out.print(times[i] + ",");
            }else{
                System.out.println(times[i]);
            }
        }
    }
}
